import dayjs from 'dayjs'

export default{
    filters: {
        format(val,format){
            if(!val) return null;
            return dayjs(val).format(format);
        },
        fixed(val, format){
            let result = val;
            if(parseInt(val) < 10) {
                result =  `0${val}`;
            }
            if(format && format == 2)  result = result + '.00';
            return result;
        },
        fixedInterge2(val){
            if(!val) return val;
            if(parseInt(val) < 10 && val.toString().length == 1)
                return  `0${val}`;
            return val;
        }
    }
}
